﻿@model QuanLyGiaoVuUI.Models.GiangVienClient.DangKyGioDayGiangVienClientViewModel
@{
    ViewBag.Title = "DangKyGioDay";
    Layout = null;
}
<style>
table.dkgioday {
border-collapse: collapse;
}
table.dkgioday, table.dkgioday thread, table.dkgioday td {
border: 1px solid black;
padding:5px;
}
    #dadangky,#dangkythanhcong,#dabihuy {
        margin:20px auto;
    }
</style>
<div id="dadangky">
    <h1>Danh Sách Lịch Dạy Đã Đăng ký</h1>
    <table class="data display datatable">
        <thead>
            <tr>
                <th>STT</th>
                <th></th>
            </tr>
        </thead>
    </table>


    @*<table class="data display datatable">
            <thead>
                <tr id="">
                    <th class="table-header-options line-left" style="width: 50px;">STT</th>
                    <th class="table-header-options line-left" style="width: 100px;">Mã Lớp</th>
                    <th class="table-header-options line-left" style="width: 200px;">Tên Môn Học</th>
                    <th class="table-header-options line-left" style="width: 50px;">Thứ</th>
                    <th class="table-header-options line-left" style="width: 50px;">Tiết BĐ</th>
                    <th class="table-header-options line-left" style="width: 50px;">Tiết KT</th>
                    <th class="table-header-options line-left" style="width: 50px;">Độ Ưu Tiên</th>
                    <th class="table-header-options line-left" style="width: 150px;">Ghi Chú</th>  
                    <th>Hủy</th>                  
                </tr>
            </thead>
        @{int j = 0; var counter1 = 0;}
    @foreach (var thongtindk in Model.DanhSachDangKyGioDay)
    {
        j++;
        <tr class="gradeA @(++counter1 % 2 == 0 ? "even" : "odd")">
            <td class="odd gradeX">@j</td>
            <td class="odd gradeX">@thongtindk.LopMonHocDTO.MaLopMonHoc</td>
            <td class="odd gradeX">@thongtindk.LopMonHocDTO.MonHoc.TenMonHoc</td>  
            <td class="odd gradeX">@thongtindk.Thu</td>          
            <td class="odd gradeX">@thongtindk.TietDauDTO.TietThu - @thongtindk.TietSauDTO.TietThu</td>
            <td class="odd gradeX">@thongtindk.TietDauDTO.GioBatDau.ToString() - @thongtindk.TietSauDTO.GioKetThuc.ToString() </td>
            <td class="odd gradeX"><span>@thongtindk.DoUuTien</span></td>
            <td class="odd gradeX">@thongtindk.GhiChu</td>
            <td class="odd gradeX"><span><a href="#" class="xoadangky" rel="@thongtindk.MaThongTinGiangDay">  [X]</a></span></td>
        </tr>   
    }
    </table>
</div>
<div id="dangkythanhcong">
    <h1>Danh Sách Lịch Dạy ĐK Thành Công</h1>
    <table class="data display datatable">            
        <tr id="">
            <th class="table-header-options line-left" style="width: 50px;">STT</th>
            <th class="table-header-options line-left" style="width: 100px;">Mã Lớp</th>
            <th class="table-header-options line-left" style="width: 200px;">Tên Môn Học</th>
            <th class="table-header-options line-left" style="width: 50px;">Thứ</th>
            <th class="table-header-options line-left" style="width: 50px;">Tiết đầu</th>
            <th class="table-header-options line-left" style="width: 50px;">Tiết sau</th>
            <th class="table-header-options line-left" style="width: 50px;">Độ Ưu Tiên</th>
            <th class="table-header-options line-left" style="width: 150px;">Ghi Chú</th>
        </tr>            
        @{int m=0;
          var counter2 = 0;
          }
    @foreach (var thongtindk in Model.DanhSachDangKyGioDay)
    {
        if(!thongtindk.Huy)
        {
            m++;
            <tr class="gradeA @(++counter2 % 2 == 0 ? "even" : "odd")">
                <td class="odd gradeX">@m</td>
                <td class="odd gradeX">@thongtindk.LopMonHocDTO.MaLopMonHoc</td>
                <td class="odd gradeX">@thongtindk.LopMonHocDTO.MonHoc.TenMonHoc</td>
                <td class="odd gradeX">@thongtindk.Thu</td>
                <td class="odd gradeX">@thongtindk.TietDauDTO.TietThu</td>
                <td class="odd gradeX">@thongtindk.TietSauDTO.TietThu</td>
                <td class="odd gradeX"><span>@thongtindk.DoUuTien</span></td>                
                <td class="odd gradeX">@thongtindk.GhiChu</td>
            </tr>   
        }
    }
    </table>
</div>
<div id="dabihuy">
    <h1>Danh Sách Lịch Dạy Bị Hủy (Bởi Giáo Vụ)</h1>
    <table class="data display datatable">
            <thead>
                <tr id="">
                    <th class="table-header-options line-left" style="width: 50px;">STT</th>
                    <th class="table-header-options line-left" style="width: 100px;">Mã Lớp</th>
                    <th class="table-header-options line-left" style="width: 200px;">Tên Môn Học</th>
                    <th class="table-header-options line-left" style="width: 50px;">Thứ</th>
                    <th class="table-header-options line-left" style="width: 50px;">Tiết đầu</th>
                    <th class="table-header-options line-left" style="width: 50px;">Tiết sau</th>
                    <th class="table-header-options line-left" style="width: 50px;">Độ Ưu Tiên</th>
                    <th class="table-header-options line-left" style="width: 150px;">Ghi Chú</th>
                    <th></th>
                </tr>
            </thead>
        @{int k=0;
          var counter3 = 0;
          }
    @foreach (var thongtindk in Model.DanhSachDangKyGioDay)
    {
        if (thongtindk.Huy)
        {
            k++;
            <tr class="gradeA @(++counter3 % 2 == 0 ? "even" : "odd")">
                <td class="odd gradeX">@k</td>
                <td class="odd gradeX">@thongtindk.LopMonHocDTO.MaLopMonHoc</td>
                <td class="odd gradeX">@thongtindk.LopMonHocDTO.MonHoc.TenMonHoc</td>
                <td class="odd gradeX">@thongtindk.Thu</td>
                <td class="odd gradeX">@thongtindk.TietDauDTO.TietThu</td>
                <td class="odd gradeX">@thongtindk.TietSauDTO.TietThu</td>
                <td class="odd gradeX"><span>@thongtindk.DoUuTien</span></td>                
                <td class="odd gradeX">@thongtindk.GhiChu</td>
                <td class="odd gradeX"><span><a href="#" class="xoadangky" rel="@thongtindk.MaThongTinGiangDay">  [X]</a></span></td>
            </tr>   
        }
    }
    </table>*@
</div>
<script>
    $(document).ready(function () {        
        $('.xoadangky').click(function () {
            var maDangKy = $(this).attr("rel");
            //alert(maDangKy);
            $.post("/GiangVienClient/XoaThongTinDangKyGioDay", {thongtindkID:maDangKy}, function (data) {
                if (data.success == true) {
                    alert("Xóa Thành Công!");
                    $('.' + maDangKy).remove();
                }
                else {
                    alert("Xóa Không Thành Công!");
                }
            });
        });
    });
</script>
